package cn.zzm.support.activeMQ;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * @program: study
 * @description:模拟springMVC方式（非springboot方式） 实现request-response模式
 * @author: 周昭名
 * @create: 2019-04-10 11:37
 **/
public class TopicListener implements MessageListener {
    @Override
    public void onMessage(Message message) {
        try {
            String msg = ((TextMessage)message).getText();
            System.out.println("收到消息："+msg);
        }catch (JMSException e){
            e.printStackTrace();
        }

    }

}

